<?php
session_start();
// 假设管理员帐号如下
$username = 'colordragon';
$passwrod = '391831';
//当表单传进来的账号和密码都正确时
if($_POST['username']==$username && $_POST['password']==$passwrod){
    echo "登录成功！";
    $_SESSION['username']=$username;

    if($_POST['auto']=='yes'){
        setcookie('username',$username,time()+60*60*24*7);
    }


//账号正确自动跳到首页
    header('location:index.php');
}else{
    die("登录失败！");
}